import * as React from 'react';
import DemoStore from '../lib/stores/demo';
import {inject, observer} from 'mobx-react';
import Router from 'next/router';
import {AppContext} from 'next/app';
import {DEMO} from '../lib/consts';
import Headers from './header/headers';
type Props = {
	DemoStore: DemoStore,
	a: string
};

// const Home: NextPage = () => {
//     // const store = useStores('flagStore');  //  手动传入字符串，选择要使用的内容
//     return (<h1>Hello world!</h1>)
// };
// export default Home;
@inject('DemoStore')
@observer
class Index extends React.Component<Props> {
	static async getInitialProps(appContext: AppContext) {
		return {a: 'aaa'};
	}

	render() {
		return (
			<div>
				<Headers/>
				{/*{this.props.a}*/}
				{/*{DEMO}*/}
				{/*<p> {this.props.DemoStore.name}</p>*/}
				{/*<button onClick={() => this.props.DemoStore.setName('231')}>111</button>*/}
				{/*<div onClick={() => Router.push('/test')}>test</div>*/}
			</div>
		);
	}
}

export default Index;
